<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:include page="Redir.jsp"></jsp:include>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link href="<c:url value='/css/default.css'/>" rel="stylesheet"
	type="text/css" />
<head>
<fmt:setBundle basename="lang.message" />
<c:set var="t" value="true" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Booking Detail</title>
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/NumericOnly.js"></script>
</head>
<body>
	<%@include file="Header.jsp"%>
	<div id="wrapper">
		<div id="page-wrapper">
			<div id="page">
				<%@include file="Menu.jsp"%>
				<div id="content">
					<h2>Booking Detail</h2>
					<div>
						<table class="table-form2">
							<tr>
								<td width="130">Booking ID</td>
								<td>${booking.id}</td>
							</tr>
							<tr>
								<td>Facility</td>
								<td>${booking.facilityName}</td>
							</tr>
							<tr>
								<td>Period</td>
								<td><fmt:formatDate value="${booking.startDate}"
										pattern="dd-MMM-yyyy" var="start" /> <fmt:formatDate
										value="${booking.endDate}" pattern="dd-MMM-yyyy" var="end" />
									${start} to ${end}</td>
							</tr>
							<tr>
								<td>Priority</td>
								<td>${booking.priority}</td>
							</tr>
							<tr>
								<td>User</td>
								<td>${booking.userId}</td>
							</tr>
							<tr>
								<td>Contact Detail</td>
								<td>${booking.contactDetail}</td>
							</tr>
							<tr>
								<td>Emergency</td>
								<td>${booking.emergency ? 'Yes' : 'No'}</td>
							</tr>
							<tr>
								<td>Reason</td>
								<td>${booking.reason}</td>
							</tr>
							<c:if test="${not empty error}">
								<tr>
									<td colspan="2" style="color:red;">${error}</td>
								</tr>
							</c:if>
							<c:choose>
								<c:when test="${mode == 'approve'}">
									<tr><td>
									<form action="DetailBooking" method="post">
										<input type="hidden" name="bookId" value="${booking.id}" />
										<input type="submit" name="bookStatus" value="Approve" class="button-style" />
									</form></td><td>
									<form action="DetailBooking" method="post">
										<input type="hidden" name="bookId" value="${booking.id}" />
										<input type="submit" name="bookStatus" value="Reject" class="button-style" />
									</form>
									</td></tr>
								</c:when>
								<c:when test="${mode == 'delete'}">
									<tr><td colspan="2">
									<form action="DetailBooking" method="post">
										<input type="hidden" name="bookId" value="${booking.id}" />
										<input type="submit" name="bookStatus" value="Delete" class="button-style" />
									</form>
									</td></tr>
								</c:when>
								<c:when test="${mode == 'cancel'}">
									<tr><td colspan="2">
									<form action="DetailBooking" method="post">
										<input type="hidden" name="bookId" value="${booking.id}" />
										<input type="submit" name="bookStatus" value="Cancel" class="button-style" />
									</form>
									</td></tr>
								</c:when>
							</c:choose>
						</table>

					</div>

					</form>
				</div>
			</div>
		</div>
	</div>
	<%@include file="Footer.jsp"%>
</body>
</html>